﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Xml;
using System.Windows.Forms;

namespace LanguageAnalyse
{
    public class PublicClass
    {
 


        public static void LoadLanguage(List<LangItem> LangItemList, string fileName)
        {
            if (!File.Exists(fileName))
            {
                MessageBox.Show("文件不存在！");
                return;
            }
            //開始

            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.Load(fileName);

            XmlNode root = xmlDoc.DocumentElement;

            XmlNodeList list1 = root.SelectNodes("aplanguageb");

            foreach (XmlNode node1 in list1)
            {
                LangItem item1 = new LangItem();
                item1.lgtype = node1.SelectSingleNode("lgtype").InnerText;
                item1.lgkey = node1.SelectSingleNode("lgkey").InnerText;
                item1.lgvalue = node1.SelectSingleNode("lgvalue").InnerText;
                item1.pid = node1.SelectSingleNode("pid").InnerText;
                item1.pgid = node1.SelectSingleNode("pgid").InnerText;
                item1.gid = node1.SelectSingleNode("gid").InnerText;
                item1.fieldname = node1.SelectSingleNode("fid").InnerText;
                item1.tablename = node1.SelectSingleNode("tablename").InnerText;

                LangItemList.Add(item1);
            }

        }
    }
}
